package de.slothsoft.commons.swing;

import java.util.List;

import de.slothsoft.commons.IDisplayable;
import de.slothsoft.commons.res.CommonMessages;

public class DisplayableListTableModel extends
		AbstractListTableModel<IDisplayable> {

	private static final long serialVersionUID = 1L;

	public DisplayableListTableModel() {
		super(new String[] { CommonMessages
				.getString("TableModel.columnName.name") });
	}

	public DisplayableListTableModel(String[] columnNames) {
		super(columnNames);
	}

	public DisplayableListTableModel(List<IDisplayable> list,
			String[] columnNames) {
		super(list, columnNames);
	}

	@Override
	protected Object getProperty(IDisplayable value, int column) {
		return value == null ? "" : value.getDisplayName();
	}

}
